package org.dromara.system.util;

import cn.hutool.core.util.StrUtil;

import java.time.format.DateTimeFormatter;

/**
 * 全局公共常量
 *
 * @date 2018/10/29 blog:  code:
 */
public interface CommonConstant {

    String TIME_ZONE_GMT8 = "GMT+8";
    String TIME_FORMAT = "HH:mm:ss";
    String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";

    String YYYY_MM_DD = "yyyy-MM-dd";
    String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
    DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT);
    /**
     * 项目名称
     */
    String PROJECT_KEY = "ocp";

    /**
     * 项目版本号(banner使用)
     */
    String PROJECT_VERSION = "2.0.2";

    /**
     * token请求头名称
     */
    String TOKEN_HEADER = "Authorization";

    /**
     * The access token issued by the authorization server. This value is REQUIRED.
     */
    String ACCESS_TOKEN = "access_token";

    String TOKEN = "token";

    String BEARER_TYPE = "Bearer";

    String BASIC_HEADER = "Basic";

    String BASIC_ = "Basic ";

    /**
     * 标签 header key
     */
    String HEADER_LABEL = "x-label";

    /**
     * 标签 header 分隔符
     */
    String HEADER_LABEL_SPLIT = ",";

    /**
     * 标签或 名称
     */
    String LABEL_OR = "labelOr";

    /**
     * 标签且 名称
     */
    String LABEL_AND = "labelAnd";

    /**
     * 权重key
     */
    String WEIGHT_KEY = "weight";

    /**
     * 响应码标识
     */
    String STATUS = "statusCodeValue";

    String RESPONSE_STATUS = "status";

    /**
     * 成功标记
     */
    Integer SUCCESS = 0;

    /**
     * 失败标记
     */
    Integer FAIL = 1;


    /**
     * 删除
     */
    String STATUS_DEL = "1";

    /**
     * 正常
     */
    String STATUS_NORMAL = "0";

    /**
     * 锁定
     */
    String STATUS_LOCK = "9";

    /**
     * 人脸识别分组
     */
    String GROUP = "common";

    /**
     * 目录
     */
    Integer CATALOG = -1;

    /**
     * 菜单
     */
    Integer MENU = 1;

    /**
     * 权限
     */
    Integer PERMISSION = 2;

    /**
     * 删除标记
     */
    String DEL_FLAG = "is_del";

    /**
     * 编码
     */
    String UTF8 = "UTF-8";

    /**
     * 默认时区
     */
    String DEFAULT_TIME_ZONE = "Asia/Shanghai";

    /**
     * 统一的日期格式
     */
    String DATE_FORMAT_PATTERN = "yyyy-MM-dd";

    String DATE_FORMAT_PATTERN_S = "yyyyMMdd";

    /**
     * 统一的日期时间格式
     */
    String DATE_TIME_FORMAT_PATTERN = "yyyy-MM-dd HH:mm:ss";

    String DATE_TIME_FORMAT_PATTERN_S = "yyyy-MM-ddHH:mm:ss";

    String DATE_TIME_FORMAT_PATTERN_SSS = "yyyyMMddHHmmss";
    /**
     * 统一的时间格式
     */
    String TIME_FORMAT_PATTERN = "HH:mm:ss";

    /**
     * 格林威治时间格式
     */
    String GMT_FORMAT_PATTERN = "EEE MMM dd HH:mm:ss z yyyy";


    String DEF_USER_PASSWORD = "123456";

    String LOCK_KEY_PREFIX = "LOCK_KEY";

    /**
     * 租户id参数
     */
    String TENANT_ID_PARAM = "tenantId";


    /**
     * 日志链路追踪id信息头
     */
    String TRACE_ID_HEADER = "x-traceId-header";
    /**
     * 日志链路追踪id日志标志
     */
    String LOG_TRACE_ID = "traceId";
    /**
     * 负载均衡策略-版本号 信息头
     */
    String O_C_P_VERSION = "o-c-p-version";

    /**
     * 负载均衡策略-偏向性 ip:port
     */
    String INSTANCE_INFO = "instance";

    /**
     * 灰度网关
     */
    String GRAY_LB = "grayLb";


    /**
     * hash网关
     */
    String HASH_LB = "iphash";
    /**
     * 注册中心元数据 版本号
     */
    String METADATA_VERSION = "version";

    /**
     * 文件分隔符
     */
    String PATH_SPLIT = "/";

    /**
     * 幂等操作
     */
    String RMAP_CACHE_KEY = CommonConstant.PROJECT_KEY + StrUtil.COLON + "idempotent";

    /**
     * 提交令牌的缓存key
     */
    String SERVICE_SUBMIT_TOKEN_KEY = "%:submit:%s:%s";


    /**
     * 文件前缀
     */
    String PREFIX_FILE_KEY = CommonConstant.PROJECT_KEY + StrUtil.COLON + "file:";


    /**
     * sm 私钥
     */
    String SM_PRIVATE_KEY = CommonConstant.PROJECT_KEY + StrUtil.COLON + "security:sm_private_key::";

    Integer ONE = 1;

    Integer ZERO = 0;
}
